//
//  ZSNewsChannelViewCell.m
//  fangwangyi
//
//  Created by 臧松 on 16/4/26.
//  Copyright © 2016年 zangsong. All rights reserved.
//

#import "ZSNewsChannelViewCell.h"

@interface ZSNewsChannelViewCell ()

@property (nonatomic,strong) UILabel * labelName;

@end
@implementation ZSNewsChannelViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //self.contentView.backgroundColor = [UIColor redColor];
        
        self.labelName = [[UILabel alloc]init];
        self.labelName.textAlignment = NSTextAlignmentCenter;
        
        [self.contentView addSubview:self.labelName];
    }
    return self;
}
-(void)setChannel:(ZSChannel *)channel{
   
    _channel = channel;
    self.labelName.text = channel.tname;
    
    if (self.isSelected) {
        self.labelName.font = [UIFont systemFontOfSize:18];
        self.labelName.textColor = [UIColor redColor];
    }else{
        
        self.labelName.font = [UIFont systemFontOfSize:14];
        
        self.labelName.textColor = [UIColor blackColor];
    }
    // 根据文字大小调整 label 文字大小
    [self.labelName sizeToFit];
    
}
//-(void)layoutSubviews{
//    
//    [super layoutSubviews];
//    self.labelName.frame = CGRectMake(0, 0, 60, 30);
//    
//    [self.labelName sizeToFit];
//    
//}
@end
